package com.jiyun.feign;

import com.github.pagehelper.PageInfo;
import com.jiyun.vo.Result;
import com.jiyun.vo.day12.RivalDto;
import com.jiyun.vo.day12.RivalDto2;
import com.jiyun.vo.day12.RivalVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Author yangYingJie
 * @Date 2023/8/23 19：11
 **/
@FeignClient("day12-rival")
public interface FeignRival {
    @RequestMapping("/rivalMember/findCount")
    public Result findCount(@RequestBody RivalDto dto);

    //C端展示效果
    @RequestMapping("/rival/findCAll")
    public PageInfo<RivalVo> findCAll(@RequestBody RivalDto2 dto);

    //C端展示单个成员与竞赛的详情
    @RequestMapping("/rival/findById/{id}")
    public RivalVo findById(@PathVariable("id") String id);

    //C端报名成功之后在RivalMember中间表中添加一条数据
    @RequestMapping("/rivalMember/addRivalMember/{id}")
    public void addRivalMember(@PathVariable("id") String id);

    /**
     * 查询试卷的人数
     *
     * @param id
     * @return
     */
    @RequestMapping("/rival/findNum/{id}")
    public Integer findNum(@PathVariable("id") Integer id);

    //个人中心展示竞赛
    @RequestMapping("/rival/memberRival")
    public List<RivalVo> memberRival(@RequestBody RivalDto2 dto);
}
